Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sucrase

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sucrase

Super-fast alternative to Babel for when you can target modern JS runtimes

  • 3.35.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11M
increased by1.79%
Maintainers
1
Weekly downloads
 
Created

What is sucrase?

Sucrase is a super-fast alternative to Babel for compiling modern JavaScript into older versions that are more widely supported. It focuses on compiling non-standard syntax like JSX, TypeScript, and Flow into standard JavaScript, offering significant speed improvements over Babel.

What are sucrase's main functionalities?

JSX Compilation

Sucrase can compile JSX syntax used in React applications into standard JavaScript, making it easier to run in environments that do not support JSX natively.

import React from 'react';
const App = () => <div>Hello, Sucrase!</div>;

TypeScript Compilation

Sucrase can compile TypeScript code into plain JavaScript, allowing developers to use TypeScript's type checking features without worrying about compatibility.

import express from 'express';
const app: express.Application = express();

Flow Compilation

Sucrase provides support for Flow, a static type checker for JavaScript. It can strip Flow type annotations and compile the code into standard JavaScript.

/* @flow */
function square(n: number): number {
  return n * n;
}

Other packages similar to sucrase

Keywords

FAQs

Package last updated on 22 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc